// 网站信息表格


import React from 'react';
import {
    Card,
    Divider
} from 'antd'


export default class WebInfo extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            time: 358000,
            timeStr: '0天0分0秒'
        };
        setInterval(() => {
            let time = this.state.time + 1;
            let second = time + 1;
            let hours = 0;
            let minth = 0;
            this.setState({time: second})
            if (second >= 60) {
                minth = parseInt(second / 60);
                second = second % 60;
                if (minth >= 60) {
                    hours = parseInt(minth / 24);
                    minth = minth % 24;
                }
            }
            this.state = {time, timeStr: `${hours}时${minth}分${second}秒`};

        }, 1000);
    }

    render() {
        return (
            <div>
                <Card style={{width: 300}}>
                    <Divider>网站运营信息</Divider>
                    <p>原创文章: 89 篇</p>
                    <p>转载文章: 19 篇</p>
                    <p>最新发布：2018-10-12 12:43:12</p>
                    <p>最新评论：2018-10-13 12:23:32</p>
                    <p>总评论数：201条</p>
                    <p>总运行时：{this.state.timeStr}</p>
                </Card>
            </div>

        );
    }

}